Download our Free HTML Cheat Sheet - Quick Reference for Beginners

Setting up a cron job generator

Build a properly formatted crontab line for scheduling any recurring task on your server, with a live preview showing exactly when it'll next run.

Common cron mistakes

  • Setting both a day of the month and a day of the week expecting them to combine ("only the 1st, and only if it's a Monday"). Cron treats them as OR - 1st of month AND Monday actually runs 1st of month OR every Monday, whichever comes first.
  • Leaving a field blank thinking it means "never run this". A blank/unselected field means every value for that field - to genuinely skip a schedule, disable or remove the cron entry itself.
  • Using a relative script path like ./backup.sh instead of /home/youruser/backup.sh. Cron jobs run with a minimal environment and no working directory assumptions - relative paths (and relying on PATH for interpreters like php or python) are a common source of "it works when I run it myself but not on cron" reports.
  • Selecting both 0 and 7 for day of week thinking they're different days - both mean Sunday. Pick one, not both.
This live preview updates as you fill in the form below.
Live preview - updates as you choose options
Your crontab entry will run:
Every minute of the hour
Every hour of the day
Every day of the month
Every month of the year
Every day of the week
Next scheduled run times (based on your computer's clock and timezone)
    Or start from a common schedule

    Cron details

    Minute:
    Choose at which minute you would like the cron job to run - you can choose multiple minutes, or set to run every nth minute. '0' is the minute on the hour (e.g. 2:00pm), '1' is the first minute after (e.g. 2:01pm). If you don't choose a minute here, the cron runs every minute.
    Hour:
    Choose at which hour you would like the cron job to run - you can choose multiple hours, or set to run every nth hour. '0' is midnight (12am), '12' is noon (12pm), '22' is 10pm.
    Day:
    Choose whether to run every day, on specific days, every nth day, or the nth day of the month - e.g. picking '4th' plus "every 4 days" runs every 4 days starting on the 4th. Also setting a day of the week below runs on both that day and these days, not only when they coincide.
    Month:
    Choose whether to run every month, on specific months, or every nth month - e.g. picking 'February' plus "every 2 months" runs February, April, June, August, October and December.
    Day of week:
    Useful for "every Monday" style schedules instead of picking a day of the month. Not needed if you've already set a day of the month above - leave this as 'every day of week' in that case.

    Command details

    Command to be executed:
    Enter the command you want to run - either a path to a script, or a special command. If you're not sure of the server path, SSH into your server, navigate to the script's directory and type 'pwd' to get the path, then add the filename. You may also need to include the interpreter's own path first (e.g. 'php' or '/usr/local/bin/php').

    Examples:
    /home/myaccount/backup.cgi
    perl /home/myaccount/backup.cgi
    php /home/myaccount/clean_database.php
    /home/myaccount/monitor.sh
    touch /tmp/file.lock
    cp -Rfpud /home/myaccount /backup/myaccount/
    Send results to:

    Fill in the form, then click Generate to get your crontab line.
    </>
    Your crontab line will appear here

    About cron jobs

    A cron job is a task that runs automatically on a schedule you set, without you needing to trigger it by hand - the "cron" daemon is a scheduling service built into virtually every Linux and Unix-based server (and by extension, most web hosting). A crontab ("cron table") is simply the file listing which commands to run and when, using the five-field time format this generator builds for you. It's the Linux equivalent of Windows Task Scheduler, just controlled through a plain text file instead of a GUI.

    Common uses include automated backups of a website or database, rotating or clearing old log files, warming a cache on a schedule, sending a recurring report by email, running scheduled cleanup or maintenance scripts, and periodic health checks that alert you if a service goes down.

    A couple of usage notes for the form above: holding Ctrl (Cmd on a Mac) while clicking lets you select multiple values in one list. Leaving a list at its default ("every ...") is the same as not restricting that field at all - see the mistakes above for why that matters more than it sounds.

    Frequently asked questions

    What do the 5 fields in a crontab line actually mean?

    In order: minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-7, where both 0 and 7 mean Sunday). An asterisk (*) means "every value" for that field. This generator builds all five for you from the options above.

    Why do the "next run" times use my computer's clock?

    The preview runs entirely in your browser, so it calculates using your computer's local date, time and timezone. Your actual server may run in a different timezone - always double check the server's own time (run the "date" command over SSH) before relying on exact timing.

    What's the difference between choosing a day of the month and a day of the week?

    If you set both (e.g. "on the 1st" AND "every Monday"), cron treats them as OR, not AND - the job runs on the 1st of the month, and separately on every Monday, not only on Mondays that happen to be the 1st. Leave one as "every" if you only want to filter by the other.

    My cron job isn't running - what should I check first?

    Confirm the command's full path is correct (paths that work when you're logged in via SSH aren't always on cron's PATH), check that the script is executable (chmod +x), and look at your crontab's log output or mail (MAILTO) for error messages - most "silent failures" are a missing interpreter path or a permissions issue.